function autoPageBoxWidth() {
    var width  = (window.innerWidth)*0.282;
    var pages = document.getElementsByClassName('page-box');
    for (var i=0; i<pages.length; i++){
        pages[i].style.width = width+'px';
    }

    var categoryPages =  document.getElementsByClassName('category-page-box');
    for (var i=0; i<categoryPages.length; i++){
        var number = categoryPages[i].children.length;
        if(number < 3){
            continue;
        }
        var countWidth = number*(width+11);
        console.log(countWidth);
        categoryPages[i].style.width = countWidth+'px';
    }
}
autoPageBoxWidth();